-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Don't use embed video on community page #5159
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Don't use embed video on community page #5159
Conversation
550dd39 to
9b6c28f
Compare
9b6c28f to
97a7e19
Compare
SamantazFox
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I've made two small suggestions to reduce duplicated code.
Co-authored-by: Samantaz Fox <[email protected]>
45f532c to
d5dfceb
Compare
Fijxu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the changes, it also requires #5567 to work.
| if thin_mode | ||
| html << %(<img loading="lazy" class="thumbnail" src="/vi/) | ||
| html << attachment["videoId"] | ||
| html << %(/mqdefault.jpg" alt="" />) | ||
| else | ||
| html << %(<div class="bottom-right-overlay">) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if thin_mode | |
| html << %(<img loading="lazy" class="thumbnail" src="/vi/) | |
| html << attachment["videoId"] | |
| html << %(/mqdefault.jpg" alt="" />) | |
| else | |
| html << %(<div class="bottom-right-overlay">) | |
| end | |
| if thin_mode | |
| html << %(<div class="bottom-right-overlay">) | |
| else | |
| html << %(<img loading="lazy" class="thumbnail" src="/vi/) | |
| html << attachment["videoId"] | |
| html << %(/mqdefault.jpg" alt="" />) | |
| end |
Logic issue, when thin_mode is true IT SHOULDN'T show a thumbnail.
Before this PR:

video attachments for community posts would load an embedded video page (fetching video data, streaming links, etc.) and allowed playing the video within the community page. I imagine this could cause some rate limit issues + some unnecessary strain on some invidious instances (especially if there's multiple videos on the community page being loaded)
After this PR:

Thumbnail and some video data is shown as a link to the video page. Channel is also shown since I believe it's possible for channels to attach a video from channels that aren't there own.